package com.java.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * 个人通信录
 * @author Administrator
 *
 */
@Entity
@org.hibernate.annotations.Entity(
		selectBeforeUpdate = true, 
		dynamicInsert = true, 
		dynamicUpdate = true
)
@Table(name="address_book")
public class AddressBook implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -895983655872030707L;
	
	@Id
	@GeneratedValue
	private Long id;
	
	/**
	 * 姓名
	 */
	@Column(length=100)
	private String userName;
	
	/**
	 * 公司名称
	 */
	@Column(length=100)
	private String companyName;
	
//	/**
//	 * 职务
//	 */
//	@Column(length=100)
//	private String headship;
//	
//	/**
//	 * 所属部门
//	 */
//	@Column(length=100)
//	private String department;
	
	/**
	 * 性别
	 */
	@Column
	private Boolean sex;
	
	/**
	 * 联系电话
	 */
	@Column(length=30)
	private String telphone;
	
	/**
	 * 手机
	 */
	@Column(length=30)
	private String mobile;
	
	/**
	 * 传真
	 */
	@Column(length=30)
	private String fax;
	
	/**
	 * Email
	 */
	@Column(length=30)
	private String email;
	
	/**
	 * QQ
	 */
	@Column(length=30)
	private String qq;
	
	/**
	 * MSN
	 */
	@Column(length=30)
	private String msn;
		
	
	/**
	 * 联系地址
	 */
	@Column(length=100)
	private String address;
	
	/**
	 * 备注
	 */
	@Column(length=200)
	private String detail;

	@ManyToOne
	@NotFound(action=NotFoundAction.IGNORE)
	private User user;
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public Boolean getSex() {
		return sex;
	}

	public void setSex(Boolean sex) {
		this.sex = sex;
	}

	public String getTelphone() {
		return telphone;
	}

	public void setTelphone(String telphone) {
		this.telphone = telphone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	public String getMsn() {
		return msn;
	}

	public void setMsn(String msn) {
		this.msn = msn;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}
	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
}
